import React from 'react';
import ReactDom from 'react-dom';
import { BrowserRouter,Route } from 'react-router-dom';
import Routes from '../route.js';

// redux
import { Provider } from 'react-redux';
import store from '../redux/index.js';

const App = () => {
    return (
        <Provider store={store((window.context.state))}>
            <BrowserRouter>
                {
                   Routes.map((route, i) => {
                       return <Route key={i} {...route} />
                   })
               }
            </BrowserRouter>
       </Provider>
    )
}

ReactDom.hydrate(<App />, document.getElementById("root"));
